package com.qf.dao.impl;

import com.qf.dao.OrderDetailDao;
import com.qf.pojo.TbOrderdetail;
import com.qf.utils.DataSourceUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/8/18 20:02
 */
public class OrderDetailDaoImpl implements OrderDetailDao {
    private QueryRunner queryRunner=new QueryRunner(DataSourceUtils.getDataSource());
    @Override
    public List<TbOrderdetail> selectOrderDetail(String orderId) {
        String sql="select * from tb_orderdetail where oid=?";
        try {
            return queryRunner.query(sql,new BeanListHandler<>(TbOrderdetail.class),orderId);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

}
